# class A(object):
#     def __init__(self):
#         self.c = '拉拉'
#
#     def get_name(self,name):
#         self.c = name
#         print('酷酷的', self.c)
#
# def send(name, *args, **kwargs):
#
#     getattr(A(), name)( *args, **kwargs)
#
# send('get_name', 'python')


class Integer(object):

    def __init__(self, name):
        self.name = name

    def __get__(self, instance, owner):
        print(instance)
        if instance == None:
            return 1
        else:
            return 14

    # def __set__(self, instance, value):
    #     pass
# 描述符，帮助其他类自定义属性，通过属性访问会给Integer类中instance返回None
# 通过实例访问，不会携带None

class C(object):
    interger = Integer('age')

    def __init__(self, age):
        self.age = age

c = C(15)
#
print('Integer里的属性',c.interger)
print('C.age', c.age)